// require('./writeFile')
// require('./readFile')


// 读取文件夹里的所有内容
const fs = require('node:fs/promises')
const path = require('node:path')

require('./stream')

// 读取文件
// async function readDirectory(filePath) {
//     const isDir = await isDirectory(filePath)
//     if (isDir) {
//         const dirFiles = await fs.readdir(filePath), fileList = [];

//         for (let file of dirFiles) {
//             const files = await readDirectory(path.resolve(filePath, file))
//             fileList.push(files)
//         }

//         return { dirName: filePath, fileList }
//     } else {
//         return filePath
//     }
// }

// // 获取文件状态判断是不是文件夹
// async function isDirectory(filePath) {
//     const stat = await fs.stat(filePath)
//     return stat.isDirectory()
// }

// readDirectory(path.normalize('E://react')).then(res => {
//     console.log(JSON.stringify(res))
// })